1. Field of the Invention
The present invention relates to techniques and systems for processing digital images. More specifically, the present invention relates to a method and an apparatus for representing an area of a raster image by a centerline.
2. Related Art
As computer systems become more powerful, they are being used for increasingly computationally intensive image-processing tasks. One such task is “tracing,” which involves converting a raster image into a vector image.
Note that representing an image using vector art has many advantages. A vector image is usually resolution independent, whereas the quality of a raster image depends heavily on the resolution. Further, since a vector image has an inherent structure, it is typically much easier to edit than a raster image, which often requires the use of low-level pixel editing tools, such as Adobe® Photoshop Brush tool.
A raster image can typically be traced using two main techniques: outline (fill) tracing or centerline (stroke) tracing. Outline tracing represents boundaries of regions with filled paths, whereas centerline tracing represents parts of regions as stroked paths.
Unfortunately, current techniques for tracing can exhibit gaps in their color fill output. This “gapping” problem typically occurs because, in some situations, current tracing techniques do not respect adjacencies between regions.
To eliminate such gapping problems, a planar map based technique for tracing raster images was presented in U.S. patent application Ser. No. 11/178,526, entitled, “PLANAR MAP TO PROCESS A RASTER IMAGE,” by inventor Peter Skirko, filed on 11 Jul. 2005. Note that a planar map based tracing technique does not suffer from gapping problems because a planar map inherently respects adjacencies between regions.
Note that it is often advantageous to represent an image using a combination of outlines and centerlines because it can allow the image to be edited in an intuitive fashion.
For example, a cartoonist may want to represent certain regions of an image using centerlines instead of outlines. Specifically, a centerline could be used for the lines of the face and eyes, and outline for the pupil and ears where it is solid-filled. Using centerlines can be very advantageous because it can enable the cartoonist to intuitively edit a part of the drawing by simply manipulating the centerlines. In contrast, such editing operations can be very cumbersome when outlines are used because the cartoonist would have to simultaneously manipulate two closely spaced lines which can be very awkward.
Another advantage of using centerlines is that it allows a user to “idealize” a drawing. For example, if the user drew a wobbly line on the paper (as part of a cartoon, technical drawing, map, etc.), the user can “idealize” the line by using centerlines. Specifically, the line in the image might wobble around a thickness of 2 pt., but by using centerlines, the artist can make it exactly 2 pt. Furthermore, the user can also apply the same width across all the centerlines in the image, further idealizing it.
Hence, it is very advantageous to be able to represent an area of a raster image by a centerline. Note that planar map constructs are closely related to well known digital imaging concepts. Specifically, faces represent regions, edges represent pieces of boundaries shared by exactly two regions, and vertices represent locations where three or more regions meet. Unfortunately, centerlines are not similarly related to a well known concept in digital imaging. This makes it particularly difficult to find a way to extend a planar map representation to convey centerline information.
Once a raster image is traced, it is often operated upon by a graphics art tool. Present art generators typically use current boundaries to identify emergent boundaries on-the-fly. However, the art generator usually has no choice but to group all the emergent boundaries for a given face into a monolithic compound path. This is disadvantageous because a graphic art tool, such as Adobe® Illustrator, may not be able to edit such compound paths conveniently. Furthermore, artists typically want disjoint subfaces to be separate entities so they can delete one subface but keep the other, or use a subface in a different art piece.
Hence what is needed is a method and an apparatus for tracing raster images without the above-described problems.